﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Web_Main.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Hotel.Models.Entity" %>
<%@ Import Namespace="Resources" %>
<%@ Register TagPrefix="ajaxToolkit" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=4.1.60623.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Staff
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% List<GroupStaff> lgstaff = (List<GroupStaff>)ViewData["ListGroupStaff"];
       List<Staff> lstaff = (List<Staff>)ViewData["ListStaff"]; %>

    <div id="submenu">
        <span class="sbli" id="sbldepartment"></span><a class="sbi" href="javascript:EmployTab.open('department');"
            id="sm_department">
            <% = Resource.ManagementTeamStaff%></a><span class="sbri" id="sbrdepartment"></span>
        <span class="sbla" id="sblemployee"></span><a class="sba" href="javascript:EmployTab.open('employee');"
            id="sm_employee">
            <% = Resource.ManagementStaff%></a><span class="sbra" id="sbremployee"></span>
        <span class="sbli" id="sblsalary"></span><a class="sbi" href="javascript:EmployTab.open('salary');"
            id="sm_salary">
            <% = Resource.Wage%></a><span class="sbri" id="sbrsalary"></span></div>
    <div id="tab_room_content" style="display: none">
    </div>
    <div id="tab_cust_content" style="display: none">
    </div>
        <script type="text/javascript">
            setTimeout("CallButton()", 1000);
            function CallButton() {
                document.getElementById("sm_employee").click();
            }

    </script>
    <div id="tab_employment_content">
        <div id="EmployTab_department_content" style="display: none;">
            <div class="box ttb">
                <h1>
                    <% = Resource.ManagementTeamStaff%></h1>
                <span><a id="btaddemployeedp" class="addroom" data-reveal-id="addStaffTeam">
                    <div class="icAdd">
                    </div>
                    THÊM NHÓM</a></span>
            </div>
            <div id="addStaffTeam" class="reveal-modal" data-animation="none" data-animationspeed="10"
                data-closeonbackgroundclick="true" data-dismissmodalclass="close-reveal-modal">
                <div class="reveal-modal-title">
                    <span>THÊM NHÓM</span></div>
                <div class="reveal-modal-content">
                    <table>
                        <tr>
                            <td width="100px">
                                Tên nhóm:
                            </td>
                            <td>
                                <input type="text" name="txtTeamName" id="txtTeamName" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Ghi chú:
                            </td>
                            <td>
                                <textarea name="txtTeamNote" cols="20" rows="5" id="txtTeamNote"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Quyền:
                            </td>
                            <td>
                                <select name="sltTeamAuthorize" id="sltTeamAuthorize">
                                    <option value="1">Căn bản</option>
                                    <option value="2">Quản lý</option>
                                    <option value="3">Nhóm không quyền</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <button onclick="AddGroupStaff();">
                                    Thêm</button>
                                <button class="close-reveal-modal">
                                    Hủy</button>
                            </td>
                        </tr>
                    </table>
                    <a class="close-reveal-modal close-reveal">
                        <img src="/Content/images/exit.png" title="exit" alt="exit" /></a>
                </div>
                <label id="lblAddGroupStaffStatus" style="color: red;">
                </label>
            </div>
            <div class="box ctb">
                <table width="100%" cellpadding="5" cellspacing="0" border="0" id="tbDepartment">
                    <tbody>
                        <tr class="sicTitle" id="eptitle">
                            <td>
                                <span onclick="odbdp(&#39;dep_name&#39;)">Tên nhóm</span>
                            </td>
                            <td>
                                <span onclick="odbdp(&#39;dep_permission&#39;)">Quyền</span>
                            </td>
                            <td>
                                Ghi chú
                            </td>
                            <td class="cen">
                                Công cụ
                            </td>
                        </tr>
                        <% if (lgstaff != null && lgstaff.Count > 0)
                           {
                               for (int i = 0; i < lgstaff.Count; i++)
                               {%>
                        <tr class='<%=i%2==0?"":"lrow" %>' id="trdp710">
                            <td class="dpname" id="name710">
                                <%=lgstaff[i].Name %>
                            </td>
                            <td id="permission710">
                                <%=lgstaff[i].Authorities==1?"Căn bản" : (lgstaff[i].Authorities==2?"Quản lý" : "Nhóm không quyền") %>
                            </td>
                            <td id="note710">
                                <%=lgstaff[i].Note %>
                            </td>
                            <td class="cen" id="action710">
                                <a onclick="loadGroupStaffDetail('<%=lgstaff[i].PkGroupStaffId %>','<%=lgstaff[i].Name %>','<%=lgstaff[i].Note %>','<%=lgstaff[i].Authorities %>')"
                                    data-reveal-id="editGroupStaff">Sửa /</a><a onclick="return deletedp(&#39;710&#39;,&#39;Quản lý&#39;)">
                                        Xóa</a>
                            </td>
                        </tr>
                        <%}
                           } %>
                    </tbody>
                </table>
            </div>
            <div id="editGroupStaff" class="reveal-modal" data-animation="none" data-animationspeed="10"
                data-closeonbackgroundclick="true" data-dismissmodalclass="close-reveal-modal">
                <div class="reveal-modal-title">
                    <span>SỬA NHÓM</span></div>
                <div class="reveal-modal-content">
                    <table>
                        <tr>
                            <td width="100px">
                                Tên nhóm:
                            </td>
                            <td>
                                <input type="text" name="txtTeamNameEdit" id="txtTeamNameEdit" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Ghi chú:
                            </td>
                            <td>
                                <textarea name="txtTeamNoteEdit" cols="20" rows="5" id="txtTeamNoteEdit"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Quyền:
                            </td>
                            <td>
                                <select name="sltTeamAuthorizeEdit" id="sltTeamAuthorizeEdit">
                                    <option value="1">Căn bản</option>
                                    <option value="2">Quản lý</option>
                                    <option value="3">Nhóm không quyền</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <button onclick="EditGroupStaff();">
                                    Sửa</button>
                                <button class="close-reveal-modal">
                                    Hủy</button>
                            </td>
                        </tr>
                    </table>
                    <a class="close-reveal-modal close-reveal">
                        <img src="/Content/images/exit.png" title="exit" alt="exit" /></a>
                </div>
                <label id="lblEditGroupStaffStatus" style="color: red;">
                </label>
            </div>
        </div>
        <div id="EmployTab_employee_content">
            <div class="box ttb">
                <h1>
                    <% = Resource.ListOfStaff%></h1>
                <span><a href="javascript:;" id="addep" class="addroom" data-reveal-id="addStaffPopup">
                    <div class="icAdd">
                    </div>
                    Thêm nhân viên</a></span>
            </div>
            <div id="addStaffPopup" class="reveal-modal" style="top: 20px;" data-animation="none" data-animationspeed="10"
                data-closeonbackgroundclick="true" data-dismissmodalclass="close-reveal-modal">
                <div class="reveal-modal-title">
                    <span>THÊM NHÂN VIÊN</span></div>
                <div class="reveal-modal-content">
                    <table>
                        <tr>
                            <td width="100px">
                                Tên nhóm:
                            </td>
                            <td>
                                <select id="sltGroupStaffName">
                                    <% foreach (var gstaff in lgstaff)
                                       {%>
                                    <option value="<%=gstaff.PkGroupStaffId %>">
                                        <%=gstaff.Name %></option>
                                    <%} %>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Tên đăng nhập:
                            </td>
                            <td>
                                <input id="txtUserName" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Mật khẩu:
                            </td>
                            <td>
                                <input id="txtPassword" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Tên:
                            </td>
                            <td>
                                <input id="txtFullName" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Địa chỉ:
                            </td>
                            <td>
                                <input id="txtAddress" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Điện thoại:
                            </td>
                            <td>
                                <input id="txtPhoneNumber" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Email:
                            </td>
                            <td>
                                <input id="txtEmail" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                CMND/Passport:
                            </td>
                            <td>
                                <input id="txtPassport" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Ngày sinh:
                            </td>
                            <td>
                                <input id="txtBirthDate" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Nơi sinh:
                            </td>
                            <td>
                                <input id="txtWhereBorn" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Tạm trú:
                            </td>
                            <td>
                                <input id="txtTamTru" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Thường trú:
                            </td>
                            <td>
                                <input id="txtThuongTru" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Ngày vào làm:
                            </td>
                            <td>
                                <input id="txtDateJoinWorking" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Mức lương:
                            </td>
                            <td>
                                <input id="txtSalary" type="text" width="100" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Ghi chú:
                            </td>
                            <td>
                                <input name="txtNote" type="text" width="100" id="txtNote" />
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Ngày làm việc:
                            </td>
                            <td>
                                <select name="sltDayPerWeek" id="sltDayPerWeek">
                                    <option value="1">1 ngày</option>
                                    <option value="2">2 ngày</option>
                                    <option value="3">3 ngày</option>
                                    <option value="4">4 ngày</option>
                                    <option value="5">5 ngày</option>
                                    <option value="6">6 ngày</option>
                                    <option value="7">7 ngày</option>
                                </select>
                                /Tuần
                            </td>
                        </tr>
                        <tr>
                            <td width="100px">
                                Quyền:
                            </td>
                            <td>
                                <select name="sltPolicy" id="sltPolicy">
                                    <option value="1">Sử dụng phần mềm</option>
                                    <option value="2">Khóa sử dụng</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <button onclick="AddStaff();">
                                    Thêm</button>
                                <button class="close-reveal-modal">
                                    Hủy</button>
                            </td>
                        </tr>
                    </table>
                    <a class="close-reveal-modal close-reveal">
                        <img src="/Content/images/exit.png" title="exit" alt="exit" /></a>
                </div>
                <label id="lblAddStaffStatus" style="color: red;">
                </label>
            </div>
            <div class="box ctb">
                <table width="100%" cellpadding="5" cellspacing="0" border="0" id="tbEmployee" class="bor_round">
                    <tbody>
                        <tr class="tab_ltitle" id="epep">
                            <td>
                                Tên
                            </td>
                            <td>
                                Tên đăng nhập
                            </td>
                            <td>
                                <span onclick="odbep(&#39;dep_name&#39;)">Tên nhóm</span>
                            </td>
                            <td>
                                Điện thoại
                            </td>
                            <td>
                                Email
                            </td>
                            <td>
                                CMND/Passport
                            </td>
                            <td>
                                <span onclick="odbep(&#39;e_datework&#39;)">Ngày vào làm</span>
                            </td>
                            <td class="cen">
                                Công cụ
                            </td>
                        </tr>
                        <% for (int i=0;i< lstaff.Count;i++)
                           {%>
                        <tr class='<%=i%2==0?"eff":"even" %>' id="trepep985">
                            <td>
                                <a id="A1" class="memberinfo"><%=lstaff[i].Name %></a>
                            </td>
                            <td id="eusername985">
                                <%=lstaff[i].UserName%>
                            </td>
                            <td id="epdname985">
                                <%=lstaff[i].GroupStaff.Name %>
                            </td>
                            <td id="epfone985">
                                <%=lstaff[i].Phone%>
                            </td>
                            <td id="epemail985">
                                <%=lstaff[i].Email %>
                            </td>
                            <td id="epcmnd985">
                                <%=lstaff[i].Passport%>
                            </td>
                            <td id="epdatework985">
                                <%=lstaff[i].DateEntry.ToString("dd/MM/yyyy")%>
                            </td>
                            <td class="specialtd" align="center">
                                <a data-reveal-id="editStaffPopup" onclick="LoadStaffInfo('<%=lstaff[i].PkStaffId %>','<%=lstaff[i].GroupStaff.PkGroupStaffId %>','<%=lstaff[i].UserName %>','<%=lstaff[i].PassWord %>','<%=lstaff[i].Name %>','<%=lstaff[i].Address %>','<%=lstaff[i].Phone %>','<%=lstaff[i].Email %>','<%=lstaff[i].Passport %>','<%=lstaff[i].BirthDay %>','<%=lstaff[i].BirthPlace %>','<%=lstaff[i].Sojourn %>','<%=lstaff[i].Resident %>','<%=lstaff[i].DateEntry %>','<%=lstaff[i].Wage %>','<%=lstaff[i].Note %>','<%=lstaff[i].WorkingDay %>','<%=lstaff[i].Authorities %>');">Sửa /</a><a onclick="deleteep(&#39;985&#39;)">
                                    Xóa</a>
                            </td>
                        </tr>
                        <%} %>
                        
                    </tbody>
                </table>
            </div>
        </div>
        <%--Popup Edit Staff--%>
        <div id="editStaffPopup" class="reveal-modal" style="top: 20px;" data-animation="none" data-animationspeed="10"
            data-closeonbackgroundclick="true" data-dismissmodalclass="close-reveal-modal">
            <div class="reveal-modal-title">
                <span>SỬA NHÂN VIÊN</span></div>
            <div class="reveal-modal-content">
                <table>
                    <tr>
                        <td width="100px">
                            Tên nhóm:
                        </td>
                        <td>
                            <select id="sltGroupStaffNameEdit">
                                <% foreach (var gstaff in lgstaff)
                                   {%>
                                <option value="<%=gstaff.PkGroupStaffId %>">
                                    <%=gstaff.Name %></option>
                                <%} %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Tên đăng nhập:
                        </td>
                        <td>
                            <input id="txtUserNameEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Mật khẩu:
                        </td>
                        <td>
                            <input id="txtPasswordEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Tên:
                        </td>
                        <td>
                            <input id="txtFullNameEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Địa chỉ:
                        </td>
                        <td>
                            <input id="txtAddressEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Điện thoại:
                        </td>
                        <td>
                            <input id="txtPhoneNumberEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Email:
                        </td>
                        <td>
                            <input id="txtEmailEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            CMND/Passport:
                        </td>
                        <td>
                            <input id="txtPassportEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Ngày sinh:
                        </td>
                        <td>
                            <input id="txtBirthDateEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Nơi sinh:
                        </td>
                        <td>
                            <input id="txtWhereBornEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Tạm trú:
                        </td>
                        <td>
                            <input id="txtTamTruEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Thường trú:
                        </td>
                        <td>
                            <input id="txtThuongTruEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Ngày vào làm:
                        </td>
                        <td>
                            <input id="txtDateJoinWorkingEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Mức lương:
                        </td>
                        <td>
                            <input id="txtSalaryEdit" type="text" width="100" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Ghi chú:
                        </td>
                        <td>
                            <input name="txtNoteEdit" type="text" width="100" id="txtNoteEdit" />
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Ngày làm việc:
                        </td>
                        <td>
                            <select name="sltDayPerWeekEdit" id="sltDayPerWeekEdit">
                                <option value="1">1 ngày</option>
                                <option value="2">2 ngày</option>
                                <option value="3">3 ngày</option>
                                <option value="4">4 ngày</option>
                                <option value="5">5 ngày</option>
                                <option value="6">6 ngày</option>
                                <option value="7">7 ngày</option>
                            </select>
                            /Tuần
                        </td>
                    </tr>
                    <tr>
                        <td width="100px">
                            Quyền:
                        </td>
                        <td>
                            <select name="sltPolicyEdit" id="sltPolicyEdit">
                                <option value="1">Sử dụng phần mềm</option>
                                <option value="2">Khóa sử dụng</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <button onclick="EditStaff();">
                                Thêm</button>
                            <button class="close-reveal-modal">
                                Hủy</button>
                        </td>
                    </tr>
                </table>
                <a class="close-reveal-modal close-reveal">
                    <img src="/Content/images/exit.png" title="exit" alt="exit" /></a>
            </div>
            <label id="lblEditStaffStatus" style="color: red;">
            </label>
        </div>
        <div id="EmployTab_salary_content" style="display: none;">
            <div class="box ttb">
                <h1>
                    <% = Resource.PayrollManagement%></h1>
            </div>
            <div class="box ctb">
                <table width="100%" cellpadding="5" cellspacing="0" border="0" id="tbSalary" class="bor_round">
                    <tbody>
                        <tr class="tab_ltitle" id="eslTitle">
                            <td>
                                Tên
                            </td>
                            <td>
                                <span onclick="odbsl(&#39;e_salary&#39;)">Mức lương</span>
                            </td>
                            <td class="cen">
                                <span onclick="odbsl(&#39;e_dayoff&#39;)">Ngày nghỉ</span>
                            </td>
                            <td class="cen">
                                Lý do nghỉ
                            </td>
                            <td class="rig">
                                <span onclick="odbsl(&#39;e_advance&#39;)">Tạm ứng</span>
                            </td>
                            <td class="cen">
                                Lý do tạm ứng
                            </td>
                            <td class="cen">
                                Công cụ
                            </td>
                        </tr>
                        <tr class="eff" id="trsl954">
                            <td id="e_fullname954">
                                <a id="epfname954" class="slmemberinfo">O2b Corp</a>
                            </td>
                            <td id="sal954">
                                0
                            </td>
                            <td class="cen">
                                <span id="lbdayoff954">0</span><a class="addreason" id="off954"><img src="./Rex Hotel - http   quanlykhachsan.org - Phần mềm quản lý khách sạn , phan mem quan ly khach san1_files/add-icon.png"
                                    width="12px" alt="add"></a>
                            </td>
                            <td class="cen">
                                <span id="norsoff954">-----</span><input type="hidden" id="hdoffrs954" value="">
                            </td>
                            <td class="rig">
                                <span id="lbav954">0</span><a class="addadvance" id="av954"><img src="./Rex Hotel - http   quanlykhachsan.org - Phần mềm quản lý khách sạn , phan mem quan ly khach san1_files/add-icon.png"
                                    width="12px" alt="add"></a>
                            </td>
                            <td class="cen">
                                <span id="norsav954">-----</span><input type="hidden" id="hdavrs954" value="">
                            </td>
                            <td class="cen">
                                <a id="salrs954" class="salaryreset">Tính lương</a><input type="hidden" id="salpday954"
                                    value="0">
                            </td>
                        </tr>
                        <tr class="even" id="trsl985">
                            <td id="e_fullname985">
                                <a id="epfname985" class="slmemberinfo">O2b Corp</a>
                            </td>
                            <td id="sal985">
                                0
                            </td>
                            <td class="cen">
                                <span id="lbdayoff985">3</span><a class="addreason" id="off985"><img src="./Rex Hotel - http   quanlykhachsan.org - Phần mềm quản lý khách sạn , phan mem quan ly khach san1_files/add-icon.png"
                                    width="12px" alt="add"></a>
                            </td>
                            <td class="cen">
                                <a id="vrs985" class="viewreason">Xem lý do</a><input type="hidden" id="hdoffrs985"
                                    value=" - - 6/5/2014: 3 Ngày (ốm)">
                            </td>
                            <td class="rig">
                                <span id="lbav985">0</span><a class="addadvance" id="av985"><img src="./Rex Hotel - http   quanlykhachsan.org - Phần mềm quản lý khách sạn , phan mem quan ly khach san1_files/add-icon.png"
                                    width="12px" alt="add"></a>
                            </td>
                            <td class="cen">
                                <span id="norsav985">-----</span><input type="hidden" id="hdavrs985" value="">
                            </td>
                            <td class="cen">
                                <a id="salrs985" class="salaryreset">Tính lương</a><input type="hidden" id="salpday985"
                                    value="0">
                            </td>
                        </tr>
                        <tr class="eff" id="trsl1166">
                            <td id="e_fullname1166">
                                <a id="epfname1166" class="slmemberinfo">ACB</a>
                            </td>
                            <td id="sal1166">
                                0
                            </td>
                            <td class="cen">
                                <span id="lbdayoff1166">0</span><a class="addreason" id="off1166"><img src="./Rex Hotel - http   quanlykhachsan.org - Phần mềm quản lý khách sạn , phan mem quan ly khach san1_files/add-icon.png"
                                    width="12px" alt="add"></a>
                            </td>
                            <td class="cen">
                                <span id="norsoff1166">-----</span><input type="hidden" id="hdoffrs1166" value="">
                            </td>
                            <td class="rig">
                                <span id="lbav1166">0</span><a class="addadvance" id="av1166"><img src="./Rex Hotel - http   quanlykhachsan.org - Phần mềm quản lý khách sạn , phan mem quan ly khach san1_files/add-icon.png"
                                    width="12px" alt="add"></a>
                            </td>
                            <td class="cen">
                                <span id="norsav1166">-----</span><input type="hidden" id="hdavrs1166" value="">
                            </td>
                            <td class="cen">
                                <a id="salrs1166" class="salaryreset">Tính lương</a><input type="hidden" id="salpday1166"
                                    value="0">
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id="dialog-salaryemail" style="display: none">
                Xin chào o2b,
                <br>
                <br>
                <table style="border-collapse: collapse" border="1" cellpadding="3" cellspacing="0">
                    <tbody>
                        <tr>
                            <td width="30%">
                                Nhân viên:
                            </td>
                            <td width="70%" id="mmember">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Mức lương:
                            </td>
                            <td id="msalary">
                                :
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tạm ứng:
                            </td>
                            <td id="madvance">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tiền nghỉ:
                            </td>
                            <td>
                                <span id="moffsub"></span>&nbsp;-Số ngày nghỉ: <span id="moff"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Khoản khác:
                            </td>
                            <td id="mother">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ghi chú:
                            </td>
                            <td id="mnote">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Còn lại:
                            </td>
                            <td id="mremain">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                Còn lại = Mức lương - Tạm ứng - Tiền nghỉ +(-) Khoản khác
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ngày thanh toán
                            </td>
                            <td id="mdop">
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id="tab_sum_content" style="display: none">
    </div>
    <div id="tab_info_content" style="display: none">
    </div>
    <div id="notificationadd" class="reveal-modal" data-animation="none" data-animationspeed="10"
        data-closeonbackgroundclick="true" data-dismissmodalclass="close-reveal-modal">
        <div class="reveal-modal-title">
            <span>Thông báo</span></div>
        <div class="reveal-modal-content">
            <p id="messagetitle">
            </p>
            <br />
            <button class="close-reveal-modal">
                Đóng</button>
            <a class="close-reveal-modal close-reveal">
                <img src="/Content/images/exit.png" title="exit" alt="exit" /></a>
        </div>
    </div>
    <div style="display: none;">
        <a data-reveal-id="notificationadd" id="amessage">inline</a>
    </div>
    <input id="hdGroupStaffId" type="hidden" />
    <input id="hdStaffId" type="hidden" />
    <script type="text/javascript">
        function AddGroupStaff() {
            var name = $("#txtTeamName").val().trim();
            var note = $("#txtTeamNote").val().trim();
            var policy = $("#sltTeamAuthorize").val();
            if (name == "") {
                $("#lblAddGroupStaffStatus").text("Vui lòng nhập tên nhóm nhân viên");

                return false;
            }

            $.ajax({
                type: "POST",
                url: '/Staff/AddGroupStaff',
                data: {
                    name: name,
                    note: note,
                    grouppolicy: policy
                },

                success: function (data) {
                    //alert('cannot Find  resource');
                    //$("#lblfloor" + id).val(name);
                    window.location = "/Staff/Staff";
                },
                statusCode: {
                    404: function (content) {
                        //alert('cannot Find  resource');
                    },
                    505: function (content) {

                        // alert('internal server error');
                    },
                    200: function (data) {

                        // alert('server found');
                    },

                    500: function (content) {

                        //alert('Error found');
                    }
                },

                error: function (req, status, errorObj) {
                    alert('time out');
                }

            });
            return true;
        }
        function loadGroupStaffDetail(id, name, note, policy) {
            $("#txtTeamNameEdit").val(name);
            $("#txtTeamNoteEdit").val(note);
            $("#sltTeamAuthorizeEdit").val(policy);
            $("#hdGroupStaffId").val(id);
        }
        function EditGroupStaff() {
            var name = $("#txtTeamNameEdit").val().trim();
            var note = $("#txtTeamNoteEdit").val().trim();
            var policy = $("#sltTeamAuthorizeEdit").val();
            var id = $("#hdGroupStaffId").val();
            if (name == "") {
                $("#lblEditGroupStaffStatus").text("Vui lòng nhập tên nhóm nhân viên");

                return false;
            }

            $.ajax({
                type: "POST",
                url: '/Staff/EditGroupStaff',
                data: {
                    id: id,
                    name: name,
                    note: note,
                    grouppolicy: policy
                },

                success: function (data) {
                    //alert('cannot Find  resource');
                    //$("#lblfloor" + id).val(name);
                    window.location = "/Staff/Staff";
                },
                statusCode: {
                    404: function (content) {
                        //alert('cannot Find  resource');
                    },
                    505: function (content) {

                        // alert('internal server error');
                    },
                    200: function (data) {

                        // alert('server found');
                    },

                    500: function (content) {

                        //alert('Error found');
                    }
                },

                error: function (req, status, errorObj) {
                    alert('time out');
                }

            });
            return true;
        }

        function AddStaff() {
            var groupid = $("#sltGroupStaffName").val();
            var username = $("#txtUserName").val().trim();
            var password = $("#txtPassword").val().trim();
            var fullname = $("#txtFullName").val().trim();
            var address = $("#txtAddress").val().trim();
            var phonenumber = $("#txtPhoneNumber").val();
            var email = $("#txtEmail").val();
            var passport = $("#txtPassport").val().trim();
            var birthdate = $("#txtBirthDate").val().trim();
            var noisinh = $("#txtWhereBorn").val().trim();
            var tamtru = $("#txtTamTru").val().trim();
            var thuongtru = $("#txtThuongTru").val().trim();
            var datejoin = $("#txtDateJoinWorking").val().trim();
            var salary = $("#txtSalary").val().trim();
            var note = $("#txtNote").val().trim();
            var dayperweek = $("#sltDayPerWeek").val();
            var policy = $("#sltPolicy").val();
            if (username == "" || password == "" || fullname == "") {
                $("#lblAddStaffStatus").text("Vui lòng nhập đầy đủ các trường bắt buộc");

                return false;
            }

            $.ajax({
                type: "POST",
                url: '/Staff/AddStaff',
                data: {
                    groupstaffid: groupid,
                    username: username,
                    password: password,
                    fullname: fullname,
                    address: address,
                    phone: phonenumber,
                    email: email,
                    passport: passport,
                    birthdate: birthdate,
                    whereborn: noisinh,
                    tamtru: tamtru,
                    thuongtru: thuongtru,
                    datejoin: datejoin,
                    salary: salary,
                    note: note,
                    dateperweek: dayperweek,
                    policy: policy
                },

                success: function (data) {
                    //alert('cannot Find  resource');
                    //$("#lblfloor" + id).val(name);
                    window.location = "/Staff/Staff";
                },
                statusCode: {
                    404: function (content) {
                        //alert('cannot Find  resource');
                    },
                    505: function (content) {

                        // alert('internal server error');
                    },
                    200: function (data) {

                        // alert('server found');
                    },

                    500: function (content) {

                        //alert('Error found');
                    }
                },

                error: function (req, status, errorObj) {
                    alert('time out');
                }

            });
            return true;
        }

        function EditStaff() {
            var id = $("#hdStaffId").val();
            var groupid = $("#sltGroupStaffNameEdit").val();
            var username = $("#txtUserNameEdit").val().trim();
            var password = $("#txtPasswordEdit").val().trim();
            var fullname = $("#txtFullNameEdit").val().trim();
            var address = $("#txtAddressEdit").val().trim();
            var phonenumber = $("#txtPhoneNumberEdit").val();
            var email = $("#txtEmailEdit").val();
            var passport = $("#txtPassportEdit").val().trim();
            var birthdate = $("#txtBirthDateEdit").val().trim();
            var noisinh = $("#txtWhereBornEdit").val().trim();
            var tamtru = $("#txtTamTruEdit").val().trim();
            var thuongtru = $("#txtThuongTruEdit").val().trim();
            var datejoin = $("#txtDateJoinWorkingEdit").val().trim();
            var salary = $("#txtSalaryEdit").val().trim();
            var note = $("#txtNoteEdit").val().trim();
            var dayperweek = $("#sltDayPerWeekEdit").val();
            var policy = $("#sltPolicyEdit").val();
            if (username == "" || password == "" || fullname == "") {
                $("#lblEditStaffStatus").text("Vui lòng nhập đầy đủ các trường bắt buộc");
                return false;
            }

            $.ajax({
                type: "POST",
                url: '/Staff/EditStaff',
                data: {
                    id: id,
                    groupstaffid: groupid,
                    username: username,
                    password: password,
                    fullname: fullname,
                    address: address,
                    phone: phonenumber,
                    email: email,
                    passport: passport,
                    birthdate: birthdate,
                    whereborn: noisinh,
                    tamtru: tamtru,
                    thuongtru: thuongtru,
                    datejoin: datejoin,
                    salary: salary,
                    note: note,
                    dateperweek: dayperweek,
                    policy: policy
                },

                success: function (data) {
                    //alert('cannot Find  resource');
                    //$("#lblfloor" + id).val(name);
                    window.location = "/Staff/Staff";
                },
                statusCode: {
                    404: function (content) {
                        //alert('cannot Find  resource');
                    },
                    505: function (content) {

                        // alert('internal server error');
                    },
                    200: function (data) {

                        // alert('server found');
                    },

                    500: function (content) {

                        //alert('Error found');
                    }
                },

                error: function (req, status, errorObj) {
                    alert('time out');
                }

            });
            return true;
        }

        function LoadStaffInfo(id, groupid, username, password, fullname, address, phonenumber, email, passport, birthdate, noisinh, tamtru, thuongtru, datejoin, salary, note, dayperweek, policy) {
            $("#hdStaffId").val(id);
            $("#sltGroupStaffNameEdit").val(groupid);
            $("#txtUserNameEdit").val(username);
            $("#txtPasswordEdit").val(password);
            $("#txtFullNameEdit").val(fullname);
            $("#txtAddressEdit").val(address);
            $("#txtPhoneNumberEdit").val(phonenumber);
            $("#txtEmailEdit").val(email);
            $("#txtPassportEdit").val(passport);
            $("#txtBirthDateEdit").val(birthdate);
            $("#txtWhereBornEdit").val(noisinh);
            $("#txtTamTruEdit").val(tamtru);
            $("#txtThuongTruEdit").val(thuongtru);
            $("#txtDateJoinWorkingEdit").val(datejoin);
            $("#txtSalaryEdit").val(salary);
            $("#txtNoteEdit").val(note);
            $("#sltDayPerWeekEdit").val(dayperweek);
            $("#sltPolicyEdit").val(policy);
        }
    </script>
</asp:Content>
